/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 * 
 * If you have edited the file, please update
 * all the last-modified fields manually. Thanks!
 *
 * @last-modified by: 
 * @last-modified date: 
 * @last-modified time: 
 *
 * @author Swee Zhi
 * @date-created Nov 1, 2011    @time-created 11:51:19 AM
 *
 * @project: 
 * @module: 
 * @institution: 
 *
 */
package util.enumhelper;

import util.enumeration.Language;
import util.enumeration.TransportType;

public class LocalizedTransportType {
    // alphabetical order
    public static String getLocalizedTransportTypeAsString(TransportType transportType, String locale) {
        String localizedTransportType = "";
        
        // en_US ENGLISH, UNITED STATES
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.ENGLISH_US))) {
            localizedTransportType = getTransportType_EN_US(transportType);
        }
        // en_SG ENGLISH, SINGAPORE
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.ENGLISH_SINGAPORE))) {
            localizedTransportType = getTransportType_EN_SG(transportType);
        }
        // ms_MY MALAY, MALAYSIA
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.MALAY))) {
            localizedTransportType = getTransportType_MS_MY(transportType);
        }
        
        // zh_CN CHINESE, CHINA
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.CHINESE_CHINA))) {
            localizedTransportType = getTransportType_ZH_CN(transportType);
        }
        // other transportType...
        else {
            localizedTransportType = getTransportType_EN_US(transportType);
        }
        
        return localizedTransportType;
    }
    
    // simplified chinese (zh_CN)
    private static String getTransportType_ZH_CN(TransportType transportType) {
        String localizedTransportType = "";
        
        switch (transportType) {
            case PT: localizedTransportType = "巴士/地铁" ; break;
            case C: localizedTransportType = "汽车"; break;
            case T: localizedTransportType = "的士"; break;
        }
        return localizedTransportType;
    }
    
    // default (en_US)
    private static String getTransportType_EN_US(TransportType transportType) {
        String localizedTransportType = "";
        
        switch (transportType) {
            case PT: localizedTransportType = "Bus/MRT" ; break;
            case C: localizedTransportType = "Car"; break;
            case T: localizedTransportType = "Taxi"; break;
        }
        return localizedTransportType;
    }
    
    // singapore english (en_SG)
    private static String getTransportType_EN_SG(TransportType transportType) {
        String localizedTransportType = "";
        
        switch (transportType) {
            case PT: localizedTransportType = "Bus/MRT" ; break;
            case C: localizedTransportType = "Car"; break;
            case T: localizedTransportType = "Taxi"; break;
        }
        return localizedTransportType;
    }
    
    // bahasa malaysia (ms_MY)
    private static String getTransportType_MS_MY(TransportType transportType) {
        String localizedTransportType = "";
        
        switch (transportType) {
            case PT: localizedTransportType = "Bas/MRT" ; break;
            case C: localizedTransportType = "Kereta"; break;
            case T: localizedTransportType = "Teksi"; break;
        }
        return localizedTransportType;
    }
}
